<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use common\models\SysAdminUser;

/* @var $this yii\web\View */
/* @var $model common\models\SysAdminUser */

$this->title = SysAdminUser::getAdminUserNameById($model->id);
$this->params['breadcrumbs'][] = ['label' => 'Sys Admin Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<script>
function getResetAdminUserPassword(admin_user_id,email){
	 if(window.confirm('你确定要重置密码！')){
		 var Num="";
		 for(var i=0;i<6;i++)
		 {
			 Num+=Math.floor(Math.random()*10);
		 } 
		 $.ajax({
			url : '<?= f_url(['sys-admin-user/reset-admin-user-password']) ?>',
			type : 'get',
			dataType : 'JSON',
			data : {'pwd':Num,'admin_user_id':admin_user_id,'emial':email},
			success : function (datas) {
				alert(datas.message);		   	
			} 
		});
      }else{
         return false;
     }
}
</script>

<div class="sys-admin-user-view">

    <h1><?= Html::encode($this->title) ?></h1>
    <p>
	    <?= Html::a('返回首页', ['index', ], ['class' => 'btn btn-primary']) ?>
	    <?= Html::a('继续添加', ['create',], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('修改', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'user_name',
            'email:email',
            //'password',
            'reg_time:datetime',
            'last_ip',
            'last_login_time:datetime',
        ],
    ]) ?>

</div>